<template>
	<view class="evaluate-item">
		<view class="evaluate-left">
			<u-avatar :src="item.user.avatar"></u-avatar>
		</view>
		<view class="evaluate-right">
			<view class="evaluate-name">{{item.user.name}}</view>
			<view class="evaluate-text">{{item.content}}</view>
			<view class="evaluate-view">
				<view class="evaluate-img" @click="previewChang(item.img,index)" v-for="(items,index) in item.img" :key="index">
					<u-image radius="8"
						:src="items"
						width="100%" height="180rpx"></u-image>
				</view>
			</view>
			<view class="evaluate-time">{{item.create_time}}({{item.cond_name}})</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "commodity-evaluate",
		props: {
			item: {
				type: Object,
				default: (() => {
					return {}
				})
			}
		},
		data() {
			return {

			};
		}
	}
</script>

<style lang="scss">
	.evaluate-item {
		width: 100%;
		display: flex;
		align-items: initial;
		justify-content: space-between;
		margin-top: 20rpx;
		padding-bottom: 10px;
		border-bottom: 1px solid #ECECEC;

		.evaluate-left {
			width: 10%;

		}

		.evaluate-right {
			width: 86%;

			.evaluate-img:last-child:nth-child(3n + 2) {
				margin-right: calc((100% - 32%) / 2 * 1);
			}

			.evaluate-view {
				display: flex;
				align-items: center;
				justify-content: space-between;
				flex-wrap: wrap;

				.evaluate-img {
					width: 32%;
					margin-bottom: 20rpx;
				}
			}

			.evaluate-name {
				font-size: 28rpx;
				color: #666;
			}

			.evaluate-text {
				font-size: 28rpx;
				color: #333;
				margin: 25rpx 0;
			}

			.evaluate-time {
				font-size: 28rpx;
				color: #cac6c6;
			}
		}
	}
</style>
